<extend name="Public:mainbase" />
<block name="content">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/dhtmlxtree.css"/>
    <script language="javascript" src="__PUBLIC__/js/member.js?{:time()}"></script>
    <script language="javascript" src="__PUBLIC__/js/Validform_v5.3.2_min.js?{:time()}"></script>
    <style type="text/css">
        .Validform_checktip{line-height: 34px}
    </style>
    <a href="{:U('manageSpecialContent')}?sid={$Think.get.sid}" class="btn btn-success btn-sm" target="main">返回上一页</a>
        &nbsp;&nbsp;&nbsp;&nbsp;
    <!--  内容列表   -->
    <form name="form2" method="post">
        <table width="98%" class="table table-bordered  table-hover table-condensed "  align="center">
            <tr bgcolor="#E7E7E7" >
                <td height="28" colspan="11" background="__PUBLIC__/images/tbg.gif" style="padding-left:10px;">
                    ◆ 直播列表
                </td>
            </tr>
            <tr align="center" bgcolor="#FBFCE2" height="25">
                <td width="4%">选择</td>
                <td width="10%">组ID</td>
                <td>直播标题</td>
                <td>申请人</td>
                <td>开始时间</td>
                <td>申请时间</td>
                <td>直播状态</td>
                <td>审核状态</td>
                <td width="10%">操作</td>
            </tr>
            <foreach name="liveList" item="val">
                <tr align='center' bgcolor="#FFFFFF" height="26">
                    <td>
                        <input name="lid" type="checkbox" value="{$val.group_id}" class="np" />
                    </td>
                    <td nowrap>{$val.group_id}</td>
                    <td><a target="_blank" href="http://plive.appwuhan.com/20161119/whtv_{:MD5($val['group_id'])}">{$val.title}</a></td>
                    <td>{$val.realname}</td>
                    <td>{$val.start_time|myDate="Y-m-d H:i",###}</td>
                    <td>{$val.create_time|myDate="Y-m-d H:i",###}</td>
                    <td>
                        <switch name="val.group_status">
                            <case value="0">无</case>
                            <case value="1"><img src="__PUBLIC__/images/status-red.png"  height="12" alt=""> 待直播</case>
                            <case value="2"><img src="__PUBLIC__/images/status-gray.png" height="12" alt=""> 直播中</case>
                            <case value="3"><img src="__PUBLIC__/images/status-gray.png" height="12" alt=""> 直播结束</case>
                        </switch>
                    </td>
                    <td>
                        <switch name="val.v_status">
                            <case value="-1"><span style='color:#ccc'>草稿</span></case>
                            <case value="0"><span style='color:blue'>待审核</span></case>
                            <case value="1"><span style='color:green'>审核通过</span></case>
                            <case value="2"><span style='color:gray'>审核中</span></case>
                            <case value="3"><span style='color:red'>打回</span></case>
                        </switch>
                    </td>
                    <td>
                    	<?php if($val['is_add']) { ?>
                    	<span style="color:gray">已添加</span>
                    	<?php  } else { ?>
                        <a href="{:U('addSpecialLive')}?sid={$Think.get.sid}&group_id={$val.group_id}" class='addLive'>添加</a>
                        <?php } ?>
                    </td>
                </tr>
            </foreach>
    </form>

    <tr bgcolor="#ffffff">
                <td height="36" colspan="11">
                    &nbsp;
                    <a href="javascript:selAll()" class="btn btn-xs btn-info"><i class='glyphicon glyphicon-ok'></i> 全选</a>
                    <a href="javascript:noSelAll()" class="btn btn-xs btn-info"><i class='glyphicon glyphicon-remove'></i> 取消</a>
                    <!-- <a href="javascript:checkArc(0)" class="btn btn-xs btn-info">&nbsp;审核&nbsp;</a> -->
                    <a href="javascript:;" id="addSpecialLiveAll" class="btn btn-xs btn-info"><i class="glyphicon glyphicon-trash"></i> 添加</a>
                </td>
            </tr>
    <tr align="right" bgcolor="#F9FCEF">
        <td height="36" colspan="11" align="center">
            <div class='page'>{$showpage}</div>
        </td>
    </tr>
    </table>

      搜索表单
    <form name='form3' action='' method='get'>
    <input type="hidden" name='sid' value='{$Think.get.sid}'>
    <input type="hidden" name='group_id' value='{$val.group_id}'>
    <input type='hidden' name='dopost' value='listArchives' />
    <table width='98%'  class='table' align="center" style="margin-top:8px">
        <tr bgcolor='#EEF4EA'>
            <td background='__PUBLIC__/images/wbg.gif' align='center'>
                <table border='0' cellpadding='0' cellspacing='0' height="32">
                    <tr>
                        <td nowrap>直播标题：</td>
                        <td width='130'>
                            <input type='text' name='name' value='' style='width:120px' />
                        </td>
                    <td>
                        <input name="imageField" type="image" src="__PUBLIC__/images/button_search.gif" width="60" height="22" border="0" class="np" />
                    </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    </form>
    <style type="text/css">
        .editarticlebox{ z-index: 900 !important; }
        .modal-backdrop{z-index: 800 !important; }
    </style>

<script>
    function selAll(){
            $('[name=lid]').prop('checked',true);
        }
        function noSelAll(){
           $('[name=lid]').prop('checked',false);
        }

        $("#addSpecialLiveAll").click(function(){
            var id=$('[name=lid]:checked').map(function(){return $(this).val()});
            if(confirm('是否确定批量添加？')){
                $.post('{:U("addSpecialLiveAll")}?sid={$Think.get.sid}',{group_id_all:id.get().join()},function(data){
                    location.reload();
                })
            }
        })
</script>

</block> 